package com.ecube.maintenance.components.widget;

import com.baidu.mapapi.map.BitmapDescriptor;
import com.baidu.mapapi.map.BitmapDescriptorFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.Marker;
import com.baidu.mapapi.map.MarkerOptions;
import com.baidu.mapapi.map.OverlayOptions;
import com.baidu.mapapi.model.LatLng;
import com.ecube.maintenance.R;
import com.ecube.maintenance.pojos.AddressInfo;
import com.ecube.maintenance.pojos.SellerInfo;

/**
 * Created by Trible Chen on 2014/9/20.
 */
public class SimpleMarker {

    LatLng latLng;
    OverlayOptions options;

    public SimpleMarker(AddressInfo info){
        if ( info != null ){
            latLng = new LatLng(info.getLat(),info.getLon());
            BitmapDescriptor bitmap = BitmapDescriptorFactory.fromResource(
                    R.drawable.loc);
            options = new MarkerOptions().icon(bitmap).position(latLng);
        }
    }

//    public OverlayOptions getOptions(){
//        return options;
//    }

    public void putOnMap(MapView mapView){
        if ( options != null )
        mapView.getMap().addOverlay(options);
    }
}
